//package com.cowain.monitor.controller;
//
//import com.cowain.monitor.datasources.annotation.OperLog;
//import com.cowain.monitor.datasources.aspect.OperLogAspect;
//import com.cowain.monitor.entity.ErpCompleteEntity;
//import com.cowain.monitor.service.PmsCheckDemandService;
//import com.cowain.monitor.utils.R;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Service;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
///**
// * PMS ehr-backend
// *
// * @Classname PmsCheckDemandController
// * @Description TODO
// * @Date 2020-07-28 14:42
// * @Created 沈科举
// */
//@Slf4j
//@Service
//@RequestMapping("/erp/pms")
//public class PmsCheckDemandController {
//    @Autowired
//    private PmsCheckDemandService pmsCheckDemandService;
//
//
////    @Scheduled(cron = "0/15 * * * * ?")
//    @GetMapping("/pmsCheckDemand")
////    @OperLog(operModul = "拉取erp成品入库信息", operType = "", operDesc = "成品入库")
//    public void syncErpCheckDemand() {
//        int result = 0;
//        List<ErpCompleteEntity> erpCmpleteEntityList = pmsCheckDemandService.findErpCmpleteEntityByIsdel();
//        if (null != erpCmpleteEntityList && 0 != erpCmpleteEntityList.size()) {
//            result = pmsCheckDemandService.addPmsCheckDemand(erpCmpleteEntityList);
//            if (0 < result) {
//                result = pmsCheckDemandService.updateErpCompleteEntityIsdel(erpCmpleteEntityList);
//                if (0< result) {
////                    return R.ok("同步成功");
//                    System.out.println("成品入库同步成功");
//                    syncErpCheckDemand();
//                    return;
//
//                }
//
//            }
//            System.out.println("成品入库同步失败");
////            return R.error("同步失败");
////            return;
//        }
//        System.out.println("成品入库没有需要同步的信息");
////        return R.error("没有需要同步的信息");
//        return;
//
//    }
//
//
//}
